package com.wang.scacodetest.service.impl;

import cn.hutool.core.lang.UUID;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wang.scacodetest.domain.UserToken;
import com.wang.scacodetest.service.UserTokenService;
import com.wang.scacodetest.mapper.UserTokenMapper;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 *
 */
@Service
public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken>
    implements UserTokenService{

    @Override
    public String getUUid() {
        UserToken userToken=new UserToken();
        userToken.setCreateTime(LocalDateTime.now());
        userToken.setState(0);
        userToken.setUuid(UUID.fastUUID().toString());
        save(userToken);
        return userToken.getUuid();
    }
}




